package org.bsc.mgwt.client.widget.base;

import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.user.client.ui.HasText;
import com.google.gwt.user.client.ui.HasValue;
import com.googlecode.mgwt.ui.client.theme.base.InputCss;
import com.googlecode.mgwt.ui.client.widget.base.HasPlaceHolder;
import com.googlecode.mgwt.ui.client.widget.base.MTextBoxBase;

/**
 * 
 * @author bsorrentino
 *
 * @param <T>
 */
public abstract class MLabeledTextBoxBase<T extends MTextBoxBase> extends MLabeledWidget<T, InputCss> implements HasValue<String>, HasText, HasPlaceHolder {
	
	public MLabeledTextBoxBase() {
		super();
	}

	public MLabeledTextBoxBase(InputCss css) {
		super(css);
	}

	@Override
	public HandlerRegistration addValueChangeHandler(ValueChangeHandler<String> handler) {
		return wrapped.addValueChangeHandler(handler);
	}

	@Override
	public String getValue() {
		return wrapped.getValue();
	}

	@Override
	public void setValue(String value) {
		wrapped.setValue(value);		
	}

	@Override
	public void setValue(String value, boolean fireEvents) {
		wrapped.setValue(value, fireEvents);		
	}

	@Override
	public void setPlaceHolder(String text) {
		wrapped.setPlaceHolder(text);
		
	}

	@Override
	public String getPlaceHolder() {
		return wrapped.getPlaceHolder();
	}

	public boolean isReadOnly() {
		return wrapped.isReadOnly();
	}

	public void setReadOnly(boolean readOnly) {
		wrapped.setReadOnly(readOnly);
	}

	@Override
	public String getText() {
		return wrapped.getText();
	}

	@Override
	public void setText(String text) {
		wrapped.setText(text);
		
	}


}

